package com.yzd.learnjava.arrays;

import java.util.Arrays;
import java.util.Collections;

import com.yzd.learnjava.util.Generated;
import com.yzd.learnjava.util.Print;
import com.yzd.learnjava.util.RandomGenerator;

public class StringSorting {
	public static void main(String[] args) {
		String[] sa = Generated.array(new String[20], new RandomGenerator.String(5));
		Print.print("Before sort: " + Arrays.toString(sa));
		Arrays.sort(sa);
		Print.print("After sort: " + Arrays.toString(sa));
		
		Arrays.sort(sa, Collections.reverseOrder());
		Print.print("Reverse sort: " + Arrays.toString(sa));
		
		Arrays.sort(sa, String.CASE_INSENSITIVE_ORDER);
		Print.print("CASE_INSENSITIVE_ORDER sort: " + Arrays.toString(sa));
		
	}
}
